package oa.controller;

import java.util.List;

import javax.annotation.Resource;

import oa.bean.TUser;
import oa.service.UserService;
import oa.util.PageUtil;
import oa.util.ReturnUtil;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

@Controller
@RequestMapping("/xadmin")
public class TestController {
	@Resource
	private UserService userService;
//
//	@RequestMapping("/test/userlist")
//	public String userlist(@RequestParam(name="page", defaultValue="1") int page,
//			@RequestParam(name="rows", defaultValue="2") int rows, Model model) {
//		List<TUser> users = userService.listuser(null, null, null, null);
//		model.addAttribute("pu", new PageUtil(page, rows, users));
//		return "/xadmin/test/userlist";
//	}
//	
	@RequestMapping("/test/useradd")
	public String useradd() {
		return "/xadmin/test/useradd";
	}

	@RequestMapping("/test/userdel")
	public String userdel(Model model) {
		return ReturnUtil.returnAlert("userlist", "删除成功", model);
	}
}
